#ifndef _CLASSIFIER_H
#define _CLASSIFIER_H

#include <vector>
#include <string>

#include "SampleSpace.h"
#include "Toolkit.h"

using namespace std;

class Sample;

/** -1 the reserved class label, whenever the classifier cannot recognize the input sample, -1 is return */
class Classifier {
public:
    virtual void train(vector<Sample *> &sampleList) = 0;

    virtual void store2File(const char *modelPath) = 0;

    virtual void classify(Sample &sample) = 0;

    virtual void classifyArray(vector<Sample *> &sampleList);

    SampleSpace & getSampleSpace() {
        return *m_sampleSpace;
    }

    virtual ~Classifier(void) {
        delete m_sampleSpace;
        m_sampleSpace = NULL;
    }

protected:
    SampleSpace *m_sampleSpace;

    /**
     * @param sampleSpace context, to assure that s_dim of Sample is fixed
     */
    Classifier(SampleSpace &sampleSpace) {
        m_sampleSpace = new SampleSpace(sampleSpace.getDimension(), sampleSpace.getDistance()->getDistanceType());
    }

};

#endif
